<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <div>
        <p>
            <span>111</span>
        </p>
    </div>

    <script>

        // 克隆  cloneNode() 
        //    只复制节点本身，不管它的子元素
        //    cloneNode(true)  可以复制节点及节点相关的子元素  

        var oDiv = document.querySelector('div') ;

        var oDiv2 = oDiv.cloneNode(true) ;

        console.log(oDiv2) ;

    </script>
    
</body>
</html>